# print('hello')

# 方差
# 1. 计算平均值
# 2. 针对每个数字，分别计算数字和平均值的差值，再平方~
# 3. 把上述的平方值相加
# 4. 除以项数-1
# avg = (67.5 + 89.0 + 12.9 + 32.2) / 4
# total = (67.5 - avg) ** 2 + (89.0 - avg) ** 2 + (12.9 - avg) ** 2 + (32.2 - avg) ** 2
# result = total / 3
# print(result)

# a = 10
# b = a
# print(b)

# a = 10
# print(type(a))
# a = 'haha'
# print(type(a))

# e = 'My name is "jack"'
# print(e)
#
# e = '''My 'name' is "Jack"'''
# print(e)
#
# print(len(e))
#
# a1 = 'hello'
# a2 = ' world'
# print(a1 + a2)

# c1 = True
# c2 = False
# print(type(c1))
# print(type(c2))
#
# a:int = 10
# print(type(a))
# a:str = 'hello'
# print(type(a))

# a = 10
# print(f"a = {a}")
# print(f"a = {a + 10}")

# num = input('请输入一个整数：')
# print(f'您输入的数字是 {num}')
# a = int(num) + 10
# print(a)

# a = 10
# print(str(a) + 'hello')

# 输入四个小数，求四个小数的平均值
# a = input("请输入第一个数字：")
# b = input("请输入第一个数字：")
# c = input("请输入第一个数字：")
# d = input("请输入第一个数字：")
#
# a = float(a)
# b = float(b)
# c = float(c)
# d = float(d)
# avg = (a + b + c + d) / 4
#
# print(f'平均值是 {avg}')

# result = 1 + 2 * 3
# print(result)

# a = 4 ** 0.5
# print(a)
#
# b = 7 / 3
# print(b)
#
# b = 7 // 3
# print(b)
#
# b = -7 // 3
# print(b)
#
# b = 7 % 3
# print(b)

# 打印 1-10
# for i in range(1, 11):
#     print(i)

# 打印 2,4,6,8,10
# for i in range(2, 12, 2):
#     print(i)

# 打印从 10 到 1
# num = 10
# # while num >= 1:
# #     print(num)
# #     num -= 1
#
# for i in range(num, 0, -1):
#     print(i)

# 求 1 + 2 + 3 + ... + 100
# theSum = 0
# for i in range(1, 101):
#     theSum += i
# print(theSum)

# 假设我要吃5个包子
# for i in range(1, 6):
#     if i == 3 :
#         # 发现第三个包子，有一只虫~
#         continue
#     print(f'吃第{i}个包子')

# 还是要吃 5 个包子
# for i in range(1, 6):
#     if i == 3:
#         # 发现第三个包子，有半只虫
#         break
#     print(f'吃第{i}个包子')

# 给定若干个数字，求平均值(也不知道几个数字)
# 这个变量表示加和的结果
# theSum = 0
# # 这个变量表示有几个数字
# count = 0
# while True:
#     num = input('请输入一个数字(分号表示输入结束)：')
#     if num == ';':
#         #约定当用户输入 ; 的时候，表示输入结束
#         break
#     theSum += float(num)
#     count += 1
#
# print(f'平均值为{theSum / count}')

# 求 1-100的和
# theSum = 0
# for i in range(1, 101):
#     theSum += i
#
# print(theSum)

# 定义一个求和函数
# def calcSum(beg, end):
#     theSum = 0
#     for i in range(beg, end + 1):
#         theSum += i
#     print(theSum)
#
# # 调用函数
# # 求 1-100 的和
# calcSum(1, 100)
# # 求 300-400 的和
# calcSum(300, 400)
# # 求 1-1000 的和
# calcSum(1, 1000)

# def test():
#     print('hello')
#
# test()

# def test(a):
#     print(a)
#
# test(10)
# test('hello')
# test(True)

def add(x, y):
    return x + y

print(add(10, 20))
print(add(1.5, 2.5))
print(add('hello', 'world'))

